package com.wwg.spring.bean.init;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @类描述: TODO
 * @Author wwg
 * @date: 2021/7/14 18:47
 * @Version: 1.0
 **/
@Configuration
public class InitConfig {

    @Bean(initMethod = "init")
    public MyInitializingBean build(){
        MyInitializingBean bean = new MyInitializingBean();
        bean.setAge(79);
        System.out.println("实例化bean");
        return bean;
    }
}
